import pyautogui
import time
import win32gui
import win32con

gui = pyautogui
# 鼠标移动到指定位置
# gui.moveTo(651,700,duration=1)
# time.sleep(1)
# # 点击
# gui.click(clicks=2)
# time.sleep(1)
# # 鼠标拖拽至指定位置
# # gui.dragTo(800,100,duration=2)
# # 获取句柄
# hwnd = win32gui.FindWindow(None, "记事本")
# win32gui.ShowWindow(hwnd, win32con.SW_SHOW)
# time.sleep(1)
# # 输入文本
# gui.typewrite("hello world",interval=0.1)
# # 按下单个键
# gui.press('enter')
# 获取屏幕尺寸
print(gui.size())
# 获取鼠标当前位置
x,y = gui.position()
print(x,y)